home *** CD-ROM | disk | FTP | other *** search
- on Go2Section Num
- set movieName to InitSection(Num)
- go(1, movieName)
- end
-
- on go2ClueMovie
- global gLow, gSectData, targetWord, gSelectWord, activeword, SFormat, gsLastLabel
- set gSelectWord to EMPTY
- set gsLastLabel to EMPTY
- set lCount to the number of items in gSectData
- set high to lCount + gLow
- set activeword to SSelect(gLow)
- set clueName to the name of cast the castNum of sprite the clickOn
- set targetWord to LoseExt(clueName)
- if item activeword of gSectData = 1 then
- set audioname to makefilename(targetWord, SFormat)
- PlayAudio(audioname)
- updateStage()
- repeat4Sound()
- else
- killSprites()
- playclue()
- end if
- end
-
- on playclue
- global targetWord, gJumpName
- set lJumpName to the movieName
- if the labelList contains targetWord then
- MoviePlay(lJumpName, targetWord)
- else
- set file2get to makefilename(targetWord)
- killSprites()
- MoviePlay(file2get)
- end if
- end
-
- on CheckReward pDataList
- set lCount to the number of items in pDataList
- repeat with t = 1 to lCount
- if item t of pDataList <> 1 then
- return 0
- end if
- end repeat
- return 1
- end
-
- on PlayReward
- global gSectNum, gPlayReward, gRewardMovie
- if gPlayReward = 1 then
- CloseSection()
- set gPlayReward to 0
- go(1, gRewardMovie)
- end if
- end
-
- on CheckAllSections
- set lNumSections to RetConfig(0)
- repeat with i = 1 to lNumSections
- set lSectNum to CalcSectData(i)
- set lSectData to GetUserData(lSectNum)
- if CheckReward(lSectData) = 0 then
- return 0
- end if
- end repeat
- return 1
- end
-
- on PlayFinal
- global gPlayedFinalReward, gFinalReward
- if (gPlayedFinalReward <> 1) and (CheckAllSections() = 1) then
- set gPlayedFinalReward to 1
- go(1, gFinalReward)
- end if
- end
-
- on CloseSection
- global gSectNum, gSectData, wordlist, activeword, gInPuzzle, gPlayReward
- set gSectData to EMPTY
- set activeword to EMPTY
- set gSectNum to EMPTY
- set wordlist to EMPTY
- set gInPuzzle to 0
- set gPlayReward to 0
- killSprites()
- end
-
- on GoMainMenu
- global gMainName, gMainLabel
- if the movieName contains gMainName then
- go(gMainLabel)
- else
- if length(gMainLabel) > 0 then
- go(gMainLabel, gMainName)
- else
- go(1, gMainName)
- end if
- end if
- end
-